﻿@{
    Layout = "_LayoutPhone";
}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<!-- Bootstrap CSS -->
<!-- Material design icons CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/materializeicon/material-icons.css">

<!-- aniamte CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/animatecss/animate.css">

<!-- swiper carousel CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/swiper/css/swiper.min.css">

<!-- daterange CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/bootstrap-daterangepicker-master/daterangepicker.css">

<!-- dataTable CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/DataTables-1.10.18/css/responsive.dataTables.min.css">
<link rel="stylesheet" href="~/GoTRI/vendor/DataTables-1.10.18/css/dataTables.bootstrap4.min.css">

<!-- jvector map CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/jquery-jvectormap/jquery-jvectormap-2.0.3.css">

<script src="~/admui-13945148017-1592211513218/public/js/tsk/sweetalert.min.js"></script>
<script src="~/GoTRI/js/jquery-3.2.1.min.js"></script>
<script src="~/GoTRI/js/popper.min.js"></script>

<!-- Cookie jquery file -->
<script src="~/GoTRI/vendor/cookie/jquery.cookie.js"></script>

<!-- sparklines chart jquery file -->
<script src="~/GoTRI/vendor/sparklines/jquery.sparkline.min.js"></script>

<!-- Circular progress gauge jquery file -->
<script src="~/GoTRI/vendor/circle-progress/circle-progress.min.js"></script>

<!-- Swiper carousel jquery file -->
<script src="~/GoTRI/vendor/swiper/js/swiper.min.js"></script>

<!-- Chart js jquery file -->
<script src="~/GoTRI/vendor/chartjs/Chart.bundle.min.js"></script>
<script src="~/GoTRI/vendor/chartjs/utils.js"></script>

<!-- DataTable jquery file -->
<script src="~/GoTRI/vendor/DataTables-1.10.18/js/jquery.dataTables.min.js"></script>
<script src="~/GoTRI/vendor/DataTables-1.10.18/js/dataTables.bootstrap4.min.js"></script>
<script src="~/GoTRI/vendor/DataTables-1.10.18/js/dataTables.responsive.min.js"></script>

<!-- datepicker jquery file -->
<script src="~/GoTRI/vendor/bootstrap-daterangepicker-master/moment.js"></script>
<script src="~/GoTRI/vendor/bootstrap-daterangepicker-master/daterangepicker.js"></script>

<!-- jVector map jquery file -->
<script src="~/GoTRI/vendor/jquery-jvectormap/jquery-jvectormap.js"></script>
<script src="~/GoTRI/vendor/jquery-jvectormap/jquery-jvectormap-world-mill-en.js"></script>

<!-- circular progress file -->
<script src="~/GoTRI/vendor/circle-progress/circle-progress.min.js"></script>

<!-- Application main common jquery file -->
<script src="~/GoTRI/js/main.js"></script>
<header style="width: 100%; height: 4rem; background-color: rgb(255,135,0);top:0px;position: fixed;z-index: 1;">
    <a href="javascript:void(window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww500458ad942a211f&redirect_uri=http://web.xyufu.cn/PhoneShouYe/ShouYe&response_type=code&scope=snsapi_privateinfo&agentid=1000002&state=STATE#wechat_redirect')">
        <img src="~/GoTRI/img/left.png" alt="" style="float: left;
            width: 1rem;
            height: 2rem;
            margin-left: 1rem;
            margin-top: 1rem;
            position:absolute;
	        left:0px;
	        top:0px;
	        z-index:1;">
    </a>
    <div style=" width: 100%; height: 4rem; line-height: 4rem; text-align: center; color: #fff; font-size: 1.3rem;">意见反馈</div>
</header>
<div style="width:1px;padding-bottom:50px"></div>
<script>
    $(".yi").attr("hidden", "");
</script>
<div class="container mt-4 main-container">
    <div class="card mb-4">
        <div class="main" style="padding:0px;margin:0px;width:100%">
            <ul class="nav nav-tabs" style="border-radius: 15px;width:100%">
                <li class="nav-item" style="width:33.3%">
                    <a href="#new_cust" id="y" class="nav-link active" data-toggle="tab">
                        <span style="color: #FFA500">上报反馈</span>
                    </a>
                </li>
                <li class="nav-item" style="width: 33.3%" onclick="xuyao2()">
                    <a href="#visit_cust" id="e" class="nav-link" data-toggle="tab">
                        <span style="color: #FFA500">反馈列表</span>
                    </a>
                </li>
                <li class="nav-item" id="xuyao" style="width: 33.3%" hidden="hidden">
                    <a href="#record" id="s" onclick="" class="nav-link" data-toggle="tab">
                        <span style="color: #FFA500">查看反馈</span>
                    </a>
                </li>
            </ul>
            <div class="tab-content">
                <div id="new_cust" class="tab-pane active">
                    <div class="card-body">
                        <div class="row justify-content-center">
                            <div class="col-md-10 mx-auto">
                                <div class="form-group row">
                                    <div class="col-lg-6 col-md-6">
                                        <label>反馈意见</label>
                                        <textarea id="tt_FanKuiYijian" rows="12" cols="100" class="form-control" style="background-color: #fafafc;"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="card-footer" style="text-align: center;width:100%">
                        <button class="btn btn-success float-right" id="tijiao" onclick="add()" style="width:100%; margin-bottom:70px;">上报</button>
                    </div>
                </div>

                <div id="visit_cust" class="tab-pane">
                    <br />
                    <div id="liebiao">
                        <table class="table" id="dataTableExample" style="width:100%">
                            <thead>
                                <tr style="text-align:center;border:2px solid #DCDCDC;border-radius:5px;border-bottom: 3px solid rgb(240,123,0);">
                                    <th scope="col" style="color: #FFA500;" hidden="hidden">状态</th>
                                    <th scope="col" style="color: #FFA500;" hidden="hidden">汇报列表</th>
                                </tr>
                            </thead>
                            <tbody id="suoshuzhanqu" style="">
                            </tbody>
                        </table>
                    </div>
                    <br />
                </div>

                <div id="record" class="tab-pane" hidden="hidden">
                    <div class="card-body">
                        <div class="row justify-content-center">
                            <div class="col-lg-6 col-md-6">
                                <label>状态</label>
                                <input type="text" id="ipt_zhuangtai3" class="form-control" readonly="readonly" />
                            </div>
                        </div>
                    </div>
                    <div class="card-body">
                        <div class="row justify-content-center">
                            <div class="col-lg-6 col-md-6">
                                <label>时间</label>
                                <input type="text" id="ipt_shijian3" class="form-control" readonly="readonly" />
                            </div>
                        </div>
                    </div>
                    <div class="card-body">
                        <div class="row justify-content-center">
                            <div class="col-md-10 mx-auto">
                                <div class="form-group row">
                                    <div class="col-lg-6 col-md-6">
                                        <label>反馈内容</label>
                                        <textarea id="tt_FanKuiNeiRong3" rows="12" cols="100" class="form-control" style="background-color: #fafafc;" readonly="readonly"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="card-body">
                        <div class="row justify-content-center">
                            <div class="col-md-10 mx-auto">
                                <div class="form-group row">
                                    <div class="col-lg-6 col-md-6">
                                        <label>应答内容</label>
                                        <textarea id="tt_YingDaNeiRong3" rows="12" cols="100" class="form-control" style="background-color: #fafafc;" readonly="readonly"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div style="margin-bottom: 50px;padding-bottom:1px"></div>
@*<ul class="community-list" id="xiaoqubangding" style="color:#808080;width: 100%; height: auto; margin: 0; padding: 0; padding-bottom: 8rem; list-style: none;">
        <li class="list-item" onclick="tiaozhuan(1)" style="width: 100%; height: 5rem; background-color: rgb(241,241,241); border-radius: 15px; padding: 0 0.5rem; font-size: 0.9rem; box-shadow: 0 3px 5px 0px rgb(255,240,218);">
            <div class="item-top" style="width: 100%;height: 2.5rem;padding: 0.5rem;">
                <div></div>
                <span></span>
            </div>
            <hr style="margin: 0px 2px 10px 2px"/>
            <div class="item -bottom" style="display: flex;justify-content: space-between;">
                <div class="classroom">
                    <span>房源：</span>
                    <span> 458</span>
                </div>
                <div class="sold">
                    <span>已售：</span>
                    <span> 0</span>
                </div>
                <div class="unsold">
                    <span>未售：</span>
                    <span> 458</span>
                </div>
            </div>
        </li>
    </ul>*@
@*<ul class="community-list" id="xiaoqubangding" style="color:#808080;width: 100%; height: auto; margin: 0; padding: 0; padding-bottom: 0.5rem;padding-top:0.5rem;list-style: none;">
        <li class="list-item" onclick="tiaozhuan(1)" style="width: 100%; height: 6.5rem; background-color: rgb(241,241,241); border-radius: 15px; padding: 0 0.5rem; box-shadow: 0 3px 5px 0px rgb(255,240,218);">
            <div class="item-top" style=" width: 100%;height: 2.5rem;padding: 8px 0px;text-indent:40px;font-size:14px">
                阿达是多少按时大声大所大所多撒多撒多撒多撒多撒多大师大师大师大师大大声道啊实打实阿啊...
            </div>
            <hr style="padding:0px;margin:15px 0px 0px 0px;height:1px" />
            display: flex;justify-content: space-between;
            <div class="item -bottom" style="text-align:left;font-size:13px;">
                <span style="color:#FFA500"><b>状态：</b></span>
                <span style="">未解决</span>
            </div>
            <div class="item -bottom" style="text-align:right;font-size:13px;">
                <span style="color:#FFA500;"><b>上报时间：</b></span>
                <span style="">2020年7月30日14:57</span>
            </div>
        </li>
    </ul>*@
<script>
    $(document).ready(function () {
        liebiao();
        shujudatatable();
    })
    //添加
    function add() {
        if ($("#tt_FanKuiYijian").val() == "" || $("#tt_FanKuiYijian").val() == null || $("#tt_FanKuiYijian").val() == undefined) {
            swal("失败提示!", "反馈意见不能为空!", "error");
        } else {
            $("#nb").removeAttr("hidden");
            $("#tijiao").attr("disabled", "disabled");
            $.ajax({
                url: '../PhoneYiJianFanKui/add',
                data: { FanKui: $("#tt_FanKuiYijian").val() },
                type: "post",
                dataType: "text",
                success: function (response) {
                    $("#nb").attr("hidden", "");
                    $("#tijiao").attr("disabled", "block");
                    if (response != -1) {
                        swal("成功提示!", "反馈成功!", "success");
                        location.href = "../PhoneShouYe/ShouYe";
                    } else {
                        swal("失败提示!", "反馈成功!", "error");
                    }
                }
            });
        }
    }
    //绑定 调用YiJianFanKuiController
    function bangding(Id) {
        $("#s").removeClass("nav-link", "");
        $("#e").removeClass("nav-link active show", "");
        $("#s").addClass("nav-link active show", "");
        $("#e").addClass("nav-link", "");
        $("#xuyao").removeAttr("hidden", "");

        $("#record").removeClass("tab-pane", "");
        $("#visit_cust").removeClass("tab-pane active show", "");
        $("#record").addClass("tab-pane active show", "");
        $("#visit_cust").addClass("tab-pane", "");
        $("#record").removeAttr("hidden", "");
        $.ajax({
            type: 'POST',
            url: '../YiJianFanKui/GetById',
            async: false,
            dataType: 'json',
            data: { id: Id },
            success: function (response) {
                $(response).each(function (key) {
                    $("#ipt_zhuangtai3").val(response[key].ZhuangTai);
                    $("#ipt_shijian3").val(response[key].ShiJian);
                    $("#tt_FanKuiNeiRong3").val(response[key].FanKuiNeiRong);
                    $("#tt_YingDaNeiRong3").val(response[key].YingDaNeiRong);
                })
            },
        })
    }

    function shujudatatable() {
        var lang = {
            "sProcessing": "大量处理中，请稍后...",
            "sLengthMenu": "每页 _MENU_ 项",
            "sZeroRecords": "没有匹配结果",
            "sInfo": "当前显示第 _START_ 至 _END_ 项，共 _TOTAL_ 项。",
            "sInfoEmpty": "当前显示第 0 至 0 项，共 0 项",
            "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
            "sInfoPostFix": "",
            "sSearch": "搜索:",
            "sUrl": "",
            "sEmptyTable": "表中数据为空",
            "sLoadingRecords": "载入中...",
            "sInfoThousands": ",",
            "oPaginate": {
                "sFirst": "首页",
                "sPrevious": "上页",
                "sNext": "下页",
                "sLast": "末页",
                "sJump": "跳转"
            },
            //"oAria": {
            //    "sSortAscending": ": 以升序排列此列",
            //    "sSortDescending": ": 以降序排列此列"
            //}
        };
        $('#dataTableExample').dataTable({
            "language": lang
        });
        $("#dataTableExample_wrapper > div:first-child").attr("hidden", "");
    }

    //列表
    function liebiao() {
        $.ajax({
            type: 'POST',
            url: '../PhoneYiJianFanKui/GetListWithFenYe',
            async: false,
            dataType: 'json',
            data: {},
            success: function (date) {
                console.log(date);
                var pin = "";
                $(date).each(function (key) {
                    if (date[key].FanKuiNeiRong.length > 36) {
                        var fankui = date[key].FanKuiNeiRong.substring(0, 36) + "...";
                    } else {
                        var fankui = date[key].FanKuiNeiRong;
                    }
                    //onclick = 'yangshi()'
                    pin = "<tr style='border: 2px solid #FFFFFF;border-bottom: 2px solid #DCDCDC; border-radius: 5px;'><td hidden='hidden'></td><td><ul class='community-list' id='xiaoqubangding' style='color:#808080; width: 100%; height: auto; margin: 0; padding: 5px 10px; list-style: none;' ><li  onclick='bangding(" + date[key].Id + ")' class='list-item'  style='border-radius: 15px; width: 100%; height: 6.5rem; background-color: rgb(241, 241, 241); padding: 0 0.5rem; box-shadow: 0 3px 5px 0px #888888; border: 1px solid #888888'><div class='item-top' style='width: 100%; height: 2.5rem; padding: 8px 0px; text-indent: 40px; font-size: 14px'><span>" + fankui + "</span></div><hr style='padding: 0px; margin: 15px 0px 0px 0px; height: 1px' /><div class='item-bottom' style='text-align: left; font-size: 13px; '><span style='color:#FFA500'><b>状态：</b></span><span id='sa_zhuangtai'>" + date[key].ZhuangTai + "</span></div><div class='item-bottom' style='text-align: right; font-size: 13px; '><span style='color:#FFA500; '><b>上报时间：</b></span><span id='sa_shijian'>" + date[key].ShiJian + "</span></div></li></ul></td></tr>";
                })
                $("#suoshuzhanqu").html(pin);
            },
        })
    }

    function xuyao2() {
        $("#xuyao").attr("hidden", "");
        $("#record").attr("hidden", "");
        $("#ipt_zhuangtai3").val('');
        $("#ipt_shijian3").val('');
        $("#tt_FanKuiNeiRong3").val('');
        $("#tt_YingDaNeiRong3").val('');
    }
</script>